package com.cjj.mybatis.injector;


import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.cjj.mybatis.injector.methods.ReplaceInto;
import com.cjj.mybatis.injector.methods.ReplaceIntoByMap;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @date 2021/11/03 11:54:56
 * @author BrownC_
 * @email ccc-ju@outlook.com
 */
public class MyInjector extends DefaultSqlInjector {

    @Override
    public List<AbstractMethod> getMethodList(Class<?> mapperClass) {
        List<AbstractMethod> methodList = super.getMethodList(mapperClass);
        List<AbstractMethod> methods = Stream.of(
                        new ReplaceInto()
                        , new ReplaceIntoByMap())
                .collect(Collectors.toList());
        methodList.addAll(methods);
        return methodList;
    }

}
